找传奇、传世资源到传世资源站!

C# 实现进度条 倒着进度 以及竖着进度显示

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

用C# 实现进度条
C# 实现进度条 倒着进度 以及竖着进度显示 Windows系统编程-第1张using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;namespace VerticalProgressBar{ public partial class Form1 : Form { protected BackgroundWorker worker = null; public Form1() { InitializeComponent(); worker = new BackgroundWorker(); worker.WorkerReportsProgress = true; worker.DoWork = new DoWorkEventHandler(worker_DoWork); worker.ProgressChanged = new ProgressChangedEventHandler(worker_ProgressChanged); worker.RunWorkerCompleted = new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); worker.RunWorkerAsync(); } void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { MessageBox.Show("Complete!"); } void worker_ProgressChanged(object sender, ProgressChangedEventArgs e) { //this.progressBar1.Value = e.ProgressPercentage; this.progressBar2.Value = e.ProgressPercentage; } void worker_DoWork(object sender, DoWorkEventArgs e) { int count = 100; for (int i = 0; i <= count; i ) { Thread.Sleep(100); worker.ReportProgress(i); } } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复